import React, { useEffect, useState } from "react";
/**
 * 数字动画
 *
 */
import { AnimatingNumbers, Cell } from "@nutui/nutui-react-taro";
import styles from "./index.module.less";

const Component = () => {
  const [value, setEndNumer] = useState("1570.99");
  useEffect(() => {
    setInterval(() => {
      setEndNumer(
        `${Math.floor(Math.random() * 999999)}.${Math.floor(
          Math.random() * 89 + 10
        )}`
      );
    }, 30000);
  }, []);
  return (
    <Cell
      title={
        <AnimatingNumbers.CountUp
          value={value}
          duration={1.2}
          length={6}
          className={styles["custom-coutup"]}
        />
      }
    />
  );
};
export default Component;
